package com.hl.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import com.hl.mapper.FundFlowMapper;
import com.hl.domain.FundFlow;
import com.hl.service.IFundFlowService;

/**
 * 会员资金Service业务层处理
 * 
 * @author vv
 * @date 2025-08-05
 */
@Service
@Primary
public class FundFlowServiceImpl implements IFundFlowService 
{
    @Autowired
    private FundFlowMapper fundFlowMapper;

    /**
     * 查询会员资金
     * 
     * @param flowId 会员资金主键
     * @return 会员资金
     */
    @Override
    public FundFlow selectFundFlowByFlowId(String flowId)
    {
        return fundFlowMapper.selectFundFlowByFlowId(flowId);
    }

    @Override
    public Long selectLatestBalanceAfter(Long memberId) {
        return fundFlowMapper.selectLatestBalanceAfter(memberId);
    }

    /**
     * 查询会员资金列表
     * 
     * @param fundFlow 会员资金
     * @return 会员资金
     */
    @Override
    public List<FundFlow> selectFundFlowList(FundFlow fundFlow)
    {
        return fundFlowMapper.selectFundFlowList(fundFlow);
    }

    /**
     * 新增会员资金
     * 
     * @param fundFlow 会员资金
     * @return 结果
     */
    @Override
    public int insertFundFlow(FundFlow fundFlow)
    {
        return fundFlowMapper.insertFundFlow(fundFlow);
    }

    /**
     * 修改会员资金
     * 
     * @param fundFlow 会员资金
     * @return 结果
     */
    @Override
    public int updateFundFlow(FundFlow fundFlow)
    {
        return fundFlowMapper.updateFundFlow(fundFlow);
    }

    /**
     * 批量删除会员资金
     * 
     * @param flowIds 需要删除的会员资金主键
     * @return 结果
     */
    @Override
    public int deleteFundFlowByFlowIds(String[] flowIds)
    {
        return fundFlowMapper.deleteFundFlowByFlowIds(flowIds);
    }

    /**
     * 删除会员资金信息
     * 
     * @param flowId 会员资金主键
     * @return 结果
     */
    @Override
    public int deleteFundFlowByFlowId(String flowId)
    {
        return fundFlowMapper.deleteFundFlowByFlowId(flowId);
    }
}
